#ifndef NFA_H
#define NFA_H

#define EPS '\0'
#define EM '\1'

class NFA
{
public:
	NFA();
	NFA(std::string filename);
	~NFA();

	void addState(list<State*>*, State*);
	void setStartState(State*);
	void addTransition(State*, char, State*);
	State* getStartState();
	std::string toString();
	void ConvertToDFA();

	State* epsClosure(State*);
	void epsCloseRecursive(State*, int);
private:
	std::string sanitize(std::string);
	std::string* splitTransitionLine(std::string);
	std::map<char, int> *letterPositions;
	std::map<std::string, int> *statePositions;

	std::list<int> ** transitions;
	char* alphabetArr;
	State** stateArr;
	State** epsClosures;
	State* startState;
	int numStates, numLetters;
	std::string fileName;
};

#endif